var status = 0;
var mercury = Array(1102149, 1040138, 1041139, 1082225, 1060121, 1061142, 1072328, 1702150);
var tania = Array(1102148, 1040137, 1041138, 1082224, 1060120, 1061141, 1072327, 1702149);

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
			cm.sendNext("Whoa, how did you get here?");
		} else if (status == 1) {
			cm.sendNextPrev("I think Sera is playing tricks again..");
		} else if (status == 2) {
			cm.sendNextPrev("Can you help me?\r\nI have found lots of armor\r\nBut i don't need it!");
		} else if (status == 3) {
			cm.sendSimple("Can i offer you one of those items?\r\nTell me, what color do you like more?\r\n\r\n#L1##bBlue#l\r\n#r#L2#Red#l#k");
		} else if (status == 4) {
			switch (selection) {
				case 1:
					cm.gainItem(mercury[cm.getRandom(0, mercury.length)], 1);
					break;
				case 2:
					cm.gainItem(tania[cm.getRandom(0, tania.length)], 1);
					break;
				default:
					cm.sendOk("Unknown error, please talk to me again");
					cm.dispose();
					break;
			}
			cm.warp(809050016);
			cm.dispose();
		} 
	}
}